<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConstellationsCachesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('constellations_caches', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->string('constellation_name', 30)->default('')->comment('星座');
            $table->string('type', 20)->default('')->comment('today,tomorrow,week,month,year');
            $table->text('cache_info')->comment('缓存的接口数据');
            $table->string('date')->comment('记录日期')->nullable();
            $table->index('date');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('constellations_caches');
    }
}
